<template>
  <div style="padding:20px">
    <n-thing>
      <n-descriptions label-placement="left" bordered :column="3">
        <n-descriptions-item label="订单号">
          {{ order.orderId }}
        </n-descriptions-item>
        <n-descriptions-item label="当前状态">
          <n-tag type="success"> {{ order.orderStatus }}</n-tag>
        </n-descriptions-item>
        <n-descriptions-item label="订单类型">
          <n-tag type="info">{{ order.orderType ? '普通' : '企业订单' }}</n-tag>
        </n-descriptions-item>
        <n-descriptions-item label="用户名">
          {{ order.userName }}
        </n-descriptions-item>
        <n-descriptions-item label="手机号">
          {{ order.userPhone || '-' }}
        </n-descriptions-item>
        <n-descriptions-item label="订单关联企业">
          {{ order.enterpriseName }}
        </n-descriptions-item>
        <n-descriptions-item label="下单门店">
          {{ order.storeName }}
        </n-descriptions-item>
        <n-descriptions-item label="配送类型">
          {{ order.sendType }}
        </n-descriptions-item>
        <n-descriptions-item label="配送地址">
          {{ order.sendAddress }}
        </n-descriptions-item>
        <n-descriptions-item label="商品详情" :span="3">
          <n-descriptions label-placement="left" bordered :column="2">
            <n-descriptions-item :span="2" label="商品信息">
              <n-space v-for="goods in order.goodsInfo">
                <n-image width="40" :src="goods.pic ? goods.pic[0] : '/images/defaut.jpg'" />
                <p style="width:200px;">{{ goods.name }}(¥ {{ goods.price }}) * {{ goods.count }}</p>
                <span>¥ {{ goods.price * goods.count }}</span>
              </n-space>
            </n-descriptions-item>
            <n-descriptions-item label="商品总数">
              {{ order.goodsTotalCount }}
            </n-descriptions-item>
            <n-descriptions-item label="商品总价">
              ¥{{ order.totalAmount }}
            </n-descriptions-item>
          </n-descriptions>
        </n-descriptions-item>
        <n-descriptions-item label="其他费用" :span="3">
          <n-descriptions label-placement="left" bordered :column="1">
            <n-descriptions-item label="餐盒费">
              餐盒总价 :¥ {{ order.other.box.price * order.other.box.count }};
              单价 :¥ {{ order.other.box.price }} ;
              数量 : {{ order.other.box.count }}
            </n-descriptions-item>
            <n-descriptions-item label="配送费">¥ {{ order.other.send.price }}</n-descriptions-item>
            <n-descriptions-item label="总费用">
              ¥ {{ order.other.box.price * order.other.box.count + order.other.send.price }}
            </n-descriptions-item>
          </n-descriptions>
        </n-descriptions-item>
        <n-descriptions-item label="优惠金额" :span="3">
          <n-descriptions label-placement="left" bordered :column="1">
            <n-descriptions-item label="折扣比">
              {{ order.discountAmount.discount ? order.discountAmount.discount + ' %' : '-' }}
            </n-descriptions-item>
            <n-descriptions-item label="折扣金额">¥ {{ order.discountAmount.discountRatio }}</n-descriptions-item>
            <n-descriptions-item label="补贴">¥ {{ order.discountAmount.subsidy || '0' }}</n-descriptions-item>
            <n-descriptions-item label="总优惠金额">¥ {{ order.discountAmount.TotalDiscountMoney }}</n-descriptions-item>
          </n-descriptions>
        </n-descriptions-item>
        <n-descriptions-item label="实际支付金额" :span="3">
          <span style="color:red;font-size:20px;font-weight:600;">¥ {{ order.paymentAmount }}</span>
        </n-descriptions-item>
      </n-descriptions>
    </n-thing>
  </div>
</template>
<script lang="tsx" setup>
let props = defineProps<{
  order: any
}>();
</script>